#include <51func.h>
void * threadFunc(void *arg){
    // void * -> int *
    int * pfd = (int *)arg;
    sleep(1);
    ssize_t sret = write(*pfd,"world",5);
    ERROR_CHECK(sret,-1,"write");
}
int main(int argc, char *argv[])
{
    int fd = open("file1",O_RDWR);
    pthread_t tid;
    pthread_create(&tid,NULL,threadFunc,&fd); // int * -> void *
    write(fd,"hello",5);
    close(fd);
    pthread_join(tid,NULL);
    return 0;
}

